package com.springboot.bw.util;

/**
 * 项目规划及管理
 * 上海大数据学院院长 ：孙丰朝
 * 技术指导及需求分析：郭洵
 * 编程：楚志高
 *
 * @author bawei  bigdata sh
 * @since @Date: 2022/6/11 16:57
 */

import com.zhenzi.sms.ZhenziSmsClient;

import java.util.HashMap;
import java.util.Map;

public class ZhenZiUtil {

    private static final String  APIURL="https://sms_developer.zhenzikj.com";
    private static final String  APPID="111840";
    private static final String  APPSECRET="6932b4f2-fc3d-4940-8fa5-a5bcfaae10d5";
    private static final String  TEMPLATEID="9648";

    private static ZhenziSmsClient client = new ZhenziSmsClient(APIURL, APPID, APPSECRET);
    RandomUtil randomUtil ;

    public static void main(String[] args) {
        String s = sendMessage("18614262991","1001");
        System.out.println(s);
    }

    public static String sendMessage(String phone,String... args){
        Map<String, Object> params = new HashMap<String, Object>();
        // 发送的手机号
        params.put("number", phone);
        // 发送的模板   模板的id
        params.put("templateId", TEMPLATEID);
        // 模板中的参数

        params.put("templateParams", args);
        String result=null;
        try {
            result = client.send(params);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return result;
    }



}